<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        body{
            border:1px solid #5da3ff;
        }
    </style>
</head>
<body>
    <canvas width="500px" height="500px"></canvas>

    <script>
        let cv = document.querySelector('canvas');
        if(cv.getContext){
            let c = cv.getContext('2d');
            //贝塞尔二次曲线
            c.moveTo(100,100);
            c.quadraticCurveTo(50,150,100,200);

            c.stroke();
            
            //贝塞尔三次曲线
            c.beginPath();
            c.moveTo(300,100);
            c.bezierCurveTo(250,130,350,160,300,200)

            c.stroke();
        }else{
            console.log('您的浏览器不支持canvas,请升级浏览器');
        }

    </script>
</body>
</html>